package com.fhz.module_mine;

import androidx.lifecycle.LiveData;

import com.fhz.core_lib.api.UserApi;
import com.fhz.core_lib.entity.LoggedInUser;
import com.fhz.core_lib.mvvm.BaseRepository;
import com.fhz.core_lib.utils.ApiResponse;
import com.fhz.core_lib.utils.RetrofitFactory;

/**
 * 时间:2021/11/16
 *
 * @author msfeng
 * 简述: 参考
 */
public class MineRepository extends BaseRepository<MineModel> {

    public MineRepository(MineModel iModel) {
        super(iModel);
    }
    public LiveData<ApiResponse<String>> getQiNiuToken() {
       return iModel.getQiNiuToken();
    }

    //更新头像
    public LiveData<ApiResponse<LoggedInUser>> updateUser(String nickname , String headImg){
        UserApi userApi = RetrofitFactory.getRetrofitFactory().create(UserApi.class);
        return userApi.updateUser(nickname,headImg);
    }

}
